package cn.udrm.water.base.v1.manager.dto;

import java.util.List;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import cn.udrm.water.base.v1.manager.entities.BaseResource;

@Mapper(componentModel="spring")
public interface BaseResourceDtoMapper {

	@Mappings({
		@Mapping(source="parent.id", target="parentGuid"),
		@Mapping(source="parent.name", target="parentName")
	})
	public BaseResourceDto from(BaseResource resource);
	public BaseResource to(BaseResourceDto resourceDto);
	
	public List<BaseResourceDto> from(List<BaseResource> resources); 
}
